use std::{
    collections::HashMap,
    net::{Ipv4Addr, SocketAddr, SocketAddrV4},
    sync::Arc,
};

use apikit::doc::ApiDocument;
use server::{MockServer, MockState};

mod handler;
mod server;

#[tokio::main]
async fn main() -> anyhow::Result<()> {
    let document = ApiDocument {
        modules: vec![],
        operations: vec![],
        types: HashMap::default(),
        layers: vec![],
    };
    let document = Arc::new(document);
    let mocker = MockServer {
        addr: SocketAddr::V4(SocketAddrV4::new(Ipv4Addr::from([0, 0, 0, 0]), 8988)),
        state: MockState::from(document),
    };
    mocker.run().await?;
    Ok(())
}
